#include <pthread.h>
#include <stdio.h>

void* producterThd(void* arg) {

	for (int i = 0; i < 10; i++) {
		printf("Producter producing one item.\n");
		
		printf("Producter putting item to warehouse.\n");
	}

	pthread_exit(0);
}

void* consumerThd(void* arg) {

	for (int i = 0; i < 10; i++) {
		printf("Consumer getting item from warehouse.\n");
		
		printf("Consumer consuming the item\n");
	}

	pthread_exit(0);
}

int main() {

	pthread_t producter_tid;
	pthread_t consumer_tid;
	
	pthread_create(&producter_tid, NULL, producterThd, NULL);
	pthread_create(&consumer_tid, NULL, consumerThd, NULL);
	
	pthread_join(producter_tid, NULL);
	pthread_join(consumer_tid, NULL);

	return 0;
}
